package com.workflow.workflowproject.tools;

import lombok.Data;

import java.util.ArrayList;
import java.util.List;


public enum PcToMvEnum {
    HIDDEN("hidden","hidden",0),//隐藏
    INPUT("input","input",0),//输入框
    FIELD("input","field",0),//输入框
    CALENDAR("DatePicker","calendar",0),//数字框
    RADIO("radio","radio",1),//单选框
    CHECK_BOX("checkbox","checkbox",1),//多选框
    SELECT("select","select",1),//选择框
    SWITCH("switch","switch",0),//开关
    CASCADER("cascader","cascader",1),//级联选择器
    DATE_PICKER("DatePicker","datePicker",0),//日期选择框
    TIME_PICKER("TimePicker","timePicker",0),//时间选择框
    UPLOAD("upload","uploader",0),//上传
    RATE("rate","rate",0),//评分
    SLIDER("slider","slider",0);//滑块


    //PC端表单类型
    private String pcType;

    private PcToMvEnum(String pcType,String mvType,Integer option){
        this.pcType = pcType;
        this.mvType = mvType;
        this.option = option;
    }

    //移动端表单类型
    private String mvType;

    //是否需要翻译
    private Integer option;

    //查看该类型字段是否有option
    private Integer setOption(String type){
        PcToMvEnum[] valueList = PcToMvEnum.values();
        Integer optionType = 0;
        for(PcToMvEnum value : valueList){
            if(value.pcType.equals(type)){
                optionType = value.option;
            }
        }
        return optionType;
    }
}
